Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all controllers in the same process #313

Merged
merged 3 commits into from
Aug 7, 2018

Conversation

grantr
Copy link
Contributor

@grantr grantr commented Aug 2, 2018

controller-runtime implements its own command wrapper, but it can still run in the same process as other controllers. This moves them to a single deployment to keep logs for all controllers in one place.

Since controller-runtime defines its own kubeconfig and master flags, we have to remove them from the init here, but they should still work the same (since flags are global).

Fixes #309

Proposed Changes

  • Eliminate the controller-manager deployment.
  • Run all controllers in the eventing-controller pod.

/cc @pmorie

@google-prow-robot google-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 2, 2018
@grantr grantr force-pushed the combine-controllers branch from bfcaf60 to 3f3598d Compare August 2, 2018 23:24
@grantr
Copy link
Contributor Author

grantr commented Aug 2, 2018

/retest

@evankanderson
Copy link
Member

evankanderson commented Aug 2, 2018 via email

@scothis
Copy link
Contributor

scothis commented Aug 3, 2018

/lgtm
/test pull-knative-eventing-integration-tests

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2018
@pmorie
Copy link
Member

pmorie commented Aug 3, 2018

This is LGTM to me as well, thanks for doing this!

// crMain runs controllers written for controller-runtime. It's intended to be
// called from main(). As controllers are migrated to use controller-runtime,
// their initialization should be moved to this function.
func crMain() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not in-love with crMain, Perhaps controllerRuntimeStart or something more descriptive without main

The other thing I have seen is _main to be the thing called after some setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I like controllerRuntimeStart. Renamed.

Copy link
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to merge with master. But

/LGTM

// Start the controller-runtime controllers.
go func() {
if err := crMain(); err != nil {
glog.Fatalf("Error running controller-runtime controllers: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should have access to logger now from the zap setup that was merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you need to rebase

@@ -1,33 +0,0 @@
# Copyright 2018 The Knative Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@google-prow-robot
Copy link

New changes are detected. LGTM label has been removed.

@google-prow-robot google-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2018
@google-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: grantr
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: evankanderson

If they are not already assigned, you can assign the PR to them by writing /assign @evankanderson in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@grantr grantr force-pushed the combine-controllers branch from 41974b7 to db2fc1f Compare August 3, 2018 17:15
@google-prow-robot google-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 3, 2018
controller-runtime implements its own command wrapper, but it can still
run in the same process as other controllers. This moves them to a
single deployment and removes the existing cmd/controller-manager
binary.
@grantr grantr force-pushed the combine-controllers branch from db2fc1f to 3be0819 Compare August 3, 2018 17:16
@grantr
Copy link
Contributor Author

grantr commented Aug 3, 2018

Rebased and RFAL @n3wscott.

@n3wscott
Copy link
Contributor

n3wscott commented Aug 4, 2018

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2018
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2018
@grantr
Copy link
Contributor Author

grantr commented Aug 6, 2018

@n3wscott More conflicts! Merged this time (the merge commit will be squashed out). RFAL.

@n3wscott
Copy link
Contributor

n3wscott commented Aug 7, 2018

/lgtm

This is going to be grand!!!

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2018
@evankanderson
Copy link
Member

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evankanderson, grantr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2018
@knative-prow-robot knative-prow-robot merged commit 73e9ded into knative:master Aug 7, 2018
Cali0707 pushed a commit to Cali0707/eventing that referenced this pull request Sep 14, 2023
* Update reconciler-test to latest commit in release-1.11

* Include latest 1.11 commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants